package org.xukai.remoting.ws.xml2soap;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.xukai.remoting.ws.xml1soap.Xml1Service;

/**
 * @author xukai
 * @desc
 * @date 2016-09-27-下午 6:19
 */
public class cxfXml2Test {

    public static void main(String[] args) {

        JaxWsProxyFactoryBean fac = new JaxWsProxyFactoryBean();
        fac.setServiceClass(Xml2Service.class);
        fac.setAddress("http://127.0.0.1:8076/webServices2?groupName=test_20160927");
        fac.getInInterceptors().add(new LoggingInInterceptor());
        fac.getOutInterceptors().add(new LoggingOutInterceptor());
        Xml2Service sv = (Xml2Service) fac.create();
        String res = sv.demo("<root><startDate>20160505</startDate></root>");
        System.out.println(res);
    }
}
